Ext.ns('AIR2.Source');
/***************
 * Source page
 *
 * NOTE: can only be called from within an Ext.onReady()
 */

AIR2.Source = function() {
    var annots = new AIR2.UI.AnnotationPanel({
        colspan: 2,
        valueField: 'srcan_value',
        creField: 'srcan_cre_dtim',
        updField: 'srcan_upd_dtim',
        winTitle: 'Source Annotations',
        storeData: AIR2.Source.ANNOTDATA,
        url: AIR2.Source.BASEURL + '/annotations'
    });
    var tags = new AIR2.UI.TagPanel({
        colspan: 1,
        title: 'Tags',
        iconCls: 'air2-icon-tag',
        storeData: AIR2.Source.TAGDATA,
        url: AIR2.Source.BASEURL + '/tags',
        tagMasterUrl: AIR2.HOMEURL + '/tag',
        allowEdit: AIR2.Source.SUMMDATA.authz.may_write
    });

    /* create the application */
    var app = new AIR2.UI.App({
        id: 'air2-app',
        items: new AIR2.UI.PanelGrid({
            items: [
                AIR2.Source.Contact(),
                AIR2.Source.Facts(),
                AIR2.Source.Submissions(),
                AIR2.Source.Experiences(),
                AIR2.Source.Activity(),
                AIR2.Source.Interests(),
                annots,
                tags,
                AIR2.Source.Organizations(),

            ]
        })
    });
    app.hideProject();
    app.showLocation('Source: '+AIR2.Format.sourceName(AIR2.Source.SUMMDATA.radix),
        'air2-icon-source', AIR2.Source.BASEURL, 'S', AIR2.Source.SUMMDATA.radix.src_uuid);
}
